package com.rui.shiliao.util;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import javax.xml.parsers.DocumentBuilderFactory;

import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import android.content.Context;
import android.util.Log;

public class XmlUtil {
    public static Map<String, Map<String, List<String>>> parse(Context paramContext, String paramString1, String paramString2) {
        ConcurrentHashMap localConcurrentHashMap1 = new ConcurrentHashMap();
        try {
            NodeList nodes1 = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(paramContext.getAssets().open(paramString1))
                    .getDocumentElement().getChildNodes();
            int len1 = nodes1.getLength();
            for (int i = 0; i < len1; i++) {
                Node node1 = nodes1.item(i);
                if ((node1.getNodeName().equals("resource")) && (((Element) node1).getAttribute("name").equals("EatWorld"))) {
                    NodeList nodes2 = node1.getChildNodes();
                    int len2 = nodes2.getLength();
                    for (int j = 0; j < len2; j++) {
                        Node node2 = nodes2.item(j);
                        if (node2.getNodeName().equals("resource")) {
                            String str1 = ((Element) node2).getAttribute("name");
                            ConcurrentHashMap localConcurrentHashMap2 = new ConcurrentHashMap();
                            NodeList nodes3 = node2.getChildNodes();
                            int len3 = nodes3.getLength();
                            for (int k = 0; k < len3; k++) {
                                Node node3 = nodes3.item(k);
                                if (node3.getNodeName().equals("resource")) {
                                    String str2 = ((Element) node3).getAttribute("name");
                                    ArrayList localArrayList = new ArrayList();
                                    NodeList nodes4 = node3.getChildNodes();
                                    int len4 = nodes4.getLength();
                                    for (int m = 0; m < len4; m++) {
                                        Node node4 = nodes4.item(m);
                                        if (node4.getNodeName().equals("resource")) {
                                            localArrayList.add(((Element) node4).getAttribute("file"));
                                        }
                                    }
                                    localConcurrentHashMap2.put(str2, localArrayList);
                                }
                            }
                            localConcurrentHashMap1.put(str1, localConcurrentHashMap2);
                        }
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            localConcurrentHashMap1 = null;
        }
        return localConcurrentHashMap1;
    }
}

/* Location:           F:\temp\tools\classes_dex2jar.jar
 * Qualified Name:     com.rui.shiliao.util.XmlUtil
 * JD-Core Version:    0.6.0
 */